package com.qf.kady.ssm.pojo;

import com.qf.kady.ssm.utils.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: kady
 * \* Date: 2021/4/21
 * \* Time: 11:50
 * \* 千峰JAVA2101班
 * \* Description: 书实体
 * \
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Book {
    private Long bookId;
    private String bookName;
    private String author;
    private String publish;
    private String isbn;
    private String introduction;
    private String language;
    private Double price;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date pubDate;
    private String pubDateStr;
    private Long classId;
    private Long number;

    private ClassInfo classInfo;
    private DropLog dropLog;

    public String getPubDateStr() {
        return pubDate!=null?DateUtil.dateToStr(pubDate,"yyyy-MM-dd"):"";
    }
}
